# 切片
num_list = [11, 22, 33, 44, 55, 66, 77, 88, 99]

# num_list[start : end : add] 取起始下标到结束下标-1结束
# 三参
print(num_list[0:3:1]) 

# start end
print(num_list[1:4])

# add 从头取到尾
print(num_list[::1])

# start
print(num_list[2::])

# end
print(num_list[:5:])
print('--------------------------')





# 集合
my_set = {'zs', 'lisi', 'ww', 'zhaoliu'}
print(my_set)
# add为集合添加元素
my_set.add('tianqi')
print(my_set)

# list ---> set
my_list = [1, 1, 2, 2, 3, 3, 4, 4, 5, 6]
num_set = set(my_list)
print(num_set)
print('--------------------------')





# 字典
# 存储某个对象 键值对  键: 值
user = {
    'name' : '张三',
    'age' : 18,
    'gender' : '男'
}

# 通过键获取对应的值
print(user['name'])

# 新增
user['phone'] = '12345'
print(user)

# 修改
user['name'] = '李四'
print(user)

# 删除
user.pop('name')
print(user)

# 获取所有的键
print(user.keys())

# 遍历
for i in user:
    print(i)
    print(user[i])